<?php

use think\migration\Seeder;

class PermissionSeed extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $this->roles();
        $this->createPermissions();
    }

    protected function roles()
    {
        \catchAdmin\permissions\model\Roles::create([
            'role_name' => '超级管理员',
            'description' => 'super user',
            'creator_id' => 1,
        ]);

        \think\facade\Db::name( 'user_has_roles')->insert([
            'role_id' => 1,
            'uid' => 1,
        ]);
    }


    protected function createPermissions()
    {
       \catcher\Utils::importTreeData($this->getPermissions(), 'permissions', 'parent_id');
    }



    protected function getPermissions()
    {
        return array(
            1 =>
                array(
                    'id' => 3,
                    'permission_name' => '权限管理',
                    'parent_id' => 0,
                    'level' => '',
                    'route' => '/permissions',
                    'icon' => 'appstore',
                    'module' => 'system',
                    'creator_id' => 1,
                    'method' => 'get',
                    'permission_mark' => 'permission@index',
                    'component' => 'pageView',
                    'redirect' => '',
                    'hide_children_in_menu' => 2,
                    'keepalive' => 1,
                    'type' => 1,
                    'sort' => 100,
                    'created_at' => 1587461455,
                    'updated_at' => 1587622113,
                    'deleted_at' => 0,
                    'children' =>
                        array(
                            0 =>
                                array(
                                    'id' => 4,
                                    'permission_name' => '用户管理',
                                    'parent_id' => 3,
                                    'level' => '3',
                                    'route' => '/permissions/users',
                                    'icon' => 'user',
                                    'module' => 'permissions',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'user@index',
                                    'component' => 'users',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 10,
                                    'created_at' => 1587461597,
                                    'updated_at' => 1587547118,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 5,
                                                    'permission_name' => '列表',
                                                    'parent_id' => 4,
                                                    'level' => '3-4',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'user@index',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587461647,
                                                    'updated_at' => 1587548455,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 6,
                                                    'permission_name' => '创建',
                                                    'parent_id' => 4,
                                                    'level' => '3-4',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'user@create',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587461696,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            2 =>
                                                array(
                                                    'id' => 7,
                                                    'permission_name' => '保存',
                                                    'parent_id' => 4,
                                                    'level' => '3-4',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'user@save',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587461721,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            3 =>
                                                array(
                                                    'id' => 8,
                                                    'permission_name' => '查看',
                                                    'parent_id' => 4,
                                                    'level' => '3-4',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'user@edit',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587461742,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            4 =>
                                                array(
                                                    'id' => 9,
                                                    'permission_name' => '更新',
                                                    'parent_id' => 4,
                                                    'level' => '3-4',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'user@update',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587461762,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            5 =>
                                                array(
                                                    'id' => 10,
                                                    'permission_name' => '删除',
                                                    'parent_id' => 4,
                                                    'level' => '3-4',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'user@delete',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587461841,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            6 =>
                                                array(
                                                    'id' => 11,
                                                    'permission_name' => '禁用',
                                                    'parent_id' => 4,
                                                    'level' => '3-4',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'user@switchStatus',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587461876,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            7 =>
                                                array(
                                                    'id' => 12,
                                                    'permission_name' => '恢复',
                                                    'parent_id' => 4,
                                                    'level' => '3-4',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'user@recover',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587461901,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                            1 =>
                                array(
                                    'id' => 13,
                                    'permission_name' => '角色管理',
                                    'parent_id' => 3,
                                    'level' => '3',
                                    'route' => '/permissions/roles',
                                    'icon' => 'usergroup-add',
                                    'module' => 'permissions',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'role@index',
                                    'component' => 'roles',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 9,
                                    'created_at' => 1587461939,
                                    'updated_at' => 1587547118,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 14,
                                                    'permission_name' => '列表',
                                                    'parent_id' => 13,
                                                    'level' => '3-13',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'role@list',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587461984,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 15,
                                                    'permission_name' => '创建',
                                                    'parent_id' => 13,
                                                    'level' => '3-13',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'role@create',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462007,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            2 =>
                                                array(
                                                    'id' => 16,
                                                    'permission_name' => '保存',
                                                    'parent_id' => 13,
                                                    'level' => '3-13',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'role@save',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462021,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            3 =>
                                                array(
                                                    'id' => 17,
                                                    'permission_name' => '查看',
                                                    'parent_id' => 13,
                                                    'level' => '3-13',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'role@edit',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462040,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            4 =>
                                                array(
                                                    'id' => 18,
                                                    'permission_name' => '更新',
                                                    'parent_id' => 13,
                                                    'level' => '3-13',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'role@update',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462058,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            5 =>
                                                array(
                                                    'id' => 19,
                                                    'permission_name' => '删除',
                                                    'parent_id' => 13,
                                                    'level' => '3-13',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'role@delete',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462070,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            6 =>
                                                array(
                                                    'id' => 20,
                                                    'permission_name' => '权限获取',
                                                    'parent_id' => 13,
                                                    'level' => '3-13',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'role@getPermissions',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462094,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                            2 =>
                                array(
                                    'id' => 21,
                                    'permission_name' => '菜单管理',
                                    'parent_id' => 3,
                                    'level' => '3',
                                    'route' => '/permissions/rules',
                                    'icon' => 'build',
                                    'module' => 'permissions',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'permission@index',
                                    'component' => 'rules',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 8,
                                    'created_at' => 1587462147,
                                    'updated_at' => 1587547118,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 22,
                                                    'permission_name' => '列表',
                                                    'parent_id' => 21,
                                                    'level' => '3-21',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'permission@index',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462205,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 23,
                                                    'permission_name' => '创建',
                                                    'parent_id' => 21,
                                                    'level' => '3-21',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'permission@create',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462232,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            2 =>
                                                array(
                                                    'id' => 24,
                                                    'permission_name' => '保存',
                                                    'parent_id' => 21,
                                                    'level' => '3-21',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'permission@save',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462250,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            3 =>
                                                array(
                                                    'id' => 25,
                                                    'permission_name' => '查看',
                                                    'parent_id' => 21,
                                                    'level' => '3-21',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'permission@edit',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462273,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            4 =>
                                                array(
                                                    'id' => 26,
                                                    'permission_name' => '更新',
                                                    'parent_id' => 21,
                                                    'level' => '3-21',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'permission@update',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462284,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            5 =>
                                                array(
                                                    'id' => 27,
                                                    'permission_name' => '删除',
                                                    'parent_id' => 21,
                                                    'level' => '3-21',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'permission@delete',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462296,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                            3 =>
                                array(
                                    'id' => 29,
                                    'permission_name' => '部门管理',
                                    'parent_id' => 3,
                                    'level' => '3',
                                    'route' => '/permissions/departments',
                                    'icon' => 'desktop',
                                    'module' => 'permissions',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'departments',
                                    'component' => 'departments',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 7,
                                    'created_at' => 1587462488,
                                    'updated_at' => 1587547118,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 30,
                                                    'permission_name' => '列表',
                                                    'parent_id' => 29,
                                                    'level' => '3-29',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'department@index',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462529,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 31,
                                                    'permission_name' => '保存',
                                                    'parent_id' => 29,
                                                    'level' => '3-29',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'department@save',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462548,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            2 =>
                                                array(
                                                    'id' => 32,
                                                    'permission_name' => '更新',
                                                    'parent_id' => 29,
                                                    'level' => '3-29',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'department@update',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462579,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            3 =>
                                                array(
                                                    'id' => 33,
                                                    'permission_name' => '删除',
                                                    'parent_id' => 29,
                                                    'level' => '3-29',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'department@delete',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462592,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                            4 =>
                                array(
                                    'id' => 34,
                                    'permission_name' => '岗位管理',
                                    'parent_id' => 3,
                                    'level' => '3',
                                    'route' => '/permissions/jobs',
                                    'icon' => 'skin',
                                    'module' => 'permissions',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'jobs',
                                    'component' => 'jobs',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 1,
                                    'created_at' => 1587462707,
                                    'updated_at' => 1587547118,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 35,
                                                    'permission_name' => '列表',
                                                    'parent_id' => 34,
                                                    'level' => '3-34',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'job@index',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462757,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 36,
                                                    'permission_name' => '保存',
                                                    'parent_id' => 34,
                                                    'level' => '3-34',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'job@save',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462774,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            2 =>
                                                array(
                                                    'id' => 37,
                                                    'permission_name' => '更新',
                                                    'parent_id' => 34,
                                                    'level' => '3-34',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'job@update',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462785,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            3 =>
                                                array(
                                                    'id' => 38,
                                                    'permission_name' => '删除',
                                                    'parent_id' => 34,
                                                    'level' => '3-34',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'job@delete',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462794,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            4 =>
                                                array(
                                                    'id' => 39,
                                                    'permission_name' => '获取全部',
                                                    'parent_id' => 34,
                                                    'level' => '3-34',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'permissions',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'job@getAll',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587462818,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                        ),
                ),
            2 =>
                array(
                    'id' => 28,
                    'permission_name' => '系统管理',
                    'parent_id' => 0,
                    'level' => '',
                    'route' => '/system',
                    'icon' => 'bar-chart',
                    'module' => 'system',
                    'creator_id' => 1,
                    'method' => 'get',
                    'permission_mark' => 'system',
                    'component' => 'pageView',
                    'redirect' => '',
                    'hide_children_in_menu' => 2,
                    'keepalive' => 2,
                    'type' => 1,
                    'sort' => 1,
                    'created_at' => 1587462349,
                    'updated_at' => 1587622113,
                    'deleted_at' => 0,
                    'children' =>
                        array(
                            0 =>
                                array(
                                    'id' => 40,
                                    'permission_name' => '数据字典',
                                    'parent_id' => 28,
                                    'level' => '28',
                                    'route' => '/system/database',
                                    'icon' => 'hdd',
                                    'module' => 'system',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'datadictory',
                                    'component' => 'database',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 8,
                                    'created_at' => 1587463087,
                                    'updated_at' => 1587547118,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 41,
                                                    'permission_name' => '查看',
                                                    'parent_id' => 40,
                                                    'level' => '28-40',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'datadictionary@view',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587463113,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 42,
                                                    'permission_name' => '列表',
                                                    'parent_id' => 40,
                                                    'level' => '28-40',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'datadictionary@tables',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 10,
                                                    'created_at' => 1587463173,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            2 =>
                                                array(
                                                    'id' => 43,
                                                    'permission_name' => '优化',
                                                    'parent_id' => 40,
                                                    'level' => '28-40',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'datadictionary@optimize',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587463201,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            3 =>
                                                array(
                                                    'id' => 44,
                                                    'permission_name' => '备份',
                                                    'parent_id' => 40,
                                                    'level' => '28-40',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'optimize@backup',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587463217,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                            1 =>
                                array(
                                    'id' => 45,
                                    'permission_name' => '附件管理',
                                    'parent_id' => 28,
                                    'level' => '28',
                                    'route' => '/attactments',
                                    'icon' => 'folder-open',
                                    'module' => 'system',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'attactments',
                                    'component' => 'attachment',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 10,
                                    'created_at' => 1587463302,
                                    'updated_at' => 1587547118,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 46,
                                                    'permission_name' => '列表',
                                                    'parent_id' => 45,
                                                    'level' => '28-45',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'attachments@index',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587463335,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 47,
                                                    'permission_name' => '删除',
                                                    'parent_id' => 45,
                                                    'level' => '28-45',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'attachments@delete',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587463355,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            2 =>
                                                array(
                                                    'id' => 48,
                                                    'permission_name' => '上传图片',
                                                    'parent_id' => 45,
                                                    'level' => '28-45',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'upload@image',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587466919,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            3 =>
                                                array(
                                                    'id' => 49,
                                                    'permission_name' => '上传文件',
                                                    'parent_id' => 45,
                                                    'level' => '28-45',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'upload@file',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587466939,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                            2 =>
                                array(
                                    'id' => 50,
                                    'permission_name' => '配置管理',
                                    'parent_id' => 28,
                                    'level' => '28',
                                    'route' => '/system/config',
                                    'icon' => 'setting',
                                    'module' => 'system',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'config',
                                    'component' => 'config',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 9,
                                    'created_at' => 1587466991,
                                    'updated_at' => 1587547118,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 51,
                                                    'permission_name' => '获取父级配置',
                                                    'parent_id' => 50,
                                                    'level' => '28-50',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'config@parent',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587467036,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 52,
                                                    'permission_name' => '存储',
                                                    'parent_id' => 50,
                                                    'level' => '28-50',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'config@save',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587467052,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            2 =>
                                                array(
                                                    'id' => 53,
                                                    'permission_name' => '获取',
                                                    'parent_id' => 50,
                                                    'level' => '28-50',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'config@read',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587467062,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                            3 =>
                                array(
                                    'id' => 54,
                                    'permission_name' => '登陆日志',
                                    'parent_id' => 28,
                                    'level' => '28',
                                    'route' => '/system/log/operate',
                                    'icon' => 'export',
                                    'module' => 'system',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'loginLog',
                                    'component' => 'loginLog',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 5,
                                    'created_at' => 1587467150,
                                    'updated_at' => 1587547118,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 56,
                                                    'permission_name' => '列表',
                                                    'parent_id' => 54,
                                                    'level' => '28-54',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'loginlog@list',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587467206,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 57,
                                                    'permission_name' => '清空',
                                                    'parent_id' => 54,
                                                    'level' => '28-54',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'loginlog@empty',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587467221,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                            4 =>
                                array(
                                    'id' => 55,
                                    'permission_name' => '操作日志',
                                    'parent_id' => 28,
                                    'level' => '28',
                                    'route' => '/system/log/login',
                                    'icon' => 'profile',
                                    'module' => 'system',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'operateLog',
                                    'component' => 'operateLog',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 1,
                                    'created_at' => 1587467180,
                                    'updated_at' => 1587547118,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 58,
                                                    'permission_name' => '列表',
                                                    'parent_id' => 55,
                                                    'level' => '28-55',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'operatelog@list',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587467246,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 59,
                                                    'permission_name' => '清空',
                                                    'parent_id' => 55,
                                                    'level' => '28-55',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'operatelog@empty',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1587467266,
                                                    'updated_at' => 1587547118,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                            5 =>
                                array(
                                    'id' => 80,
                                    'permission_name' => '代码生成',
                                    'parent_id' => 28,
                                    'level' => '28',
                                    'route' => '/generate',
                                    'icon' => 'scissor',
                                    'module' => 'system',
                                    'creator_id' => 1,
                                    'method' => 'get',
                                    'permission_mark' => 'generate',
                                    'component' => 'generate',
                                    'redirect' => '',
                                    'hide_children_in_menu' => 2,
                                    'keepalive' => 1,
                                    'type' => 1,
                                    'sort' => 1,
                                    'created_at' => 1587717452,
                                    'updated_at' => 1587717452,
                                    'deleted_at' => 0,
                                    'children' =>
                                        array(
                                            0 =>
                                                array(
                                                    'id' => 81,
                                                    'permission_name' => '生成',
                                                    'parent_id' => 80,
                                                    'level' => '28-80',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'generate@save',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1588110923,
                                                    'updated_at' => 1588110923,
                                                    'deleted_at' => 0,
                                                ),
                                            1 =>
                                                array(
                                                    'id' => 82,
                                                    'permission_name' => '预览',
                                                    'parent_id' => 80,
                                                    'level' => '28-80',
                                                    'route' => '',
                                                    'icon' => '',
                                                    'module' => 'system',
                                                    'creator_id' => 1,
                                                    'method' => 'get',
                                                    'permission_mark' => 'generate@preview',
                                                    'component' => '',
                                                    'redirect' => '',
                                                    'hide_children_in_menu' => 1,
                                                    'keepalive' => 1,
                                                    'type' => 2,
                                                    'sort' => 1,
                                                    'created_at' => 1588110962,
                                                    'updated_at' => 1588110962,
                                                    'deleted_at' => 0,
                                                ),
                                        ),
                                ),
                        ),
                ),
        );
    }
}
